/*
 * ClassicTheme.java
 * business
 *
 * Created by ChenTao on 2017/2/28.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.onekeyshare.themes.classic;

import android.content.Context;
import android.content.res.Configuration;

import com.yidiandao.business.ui.onekeyshare.OnekeyShareThemeImpl;
import com.yidiandao.business.ui.onekeyshare.themes.classic.land.EditPageLand;
import com.yidiandao.business.ui.onekeyshare.themes.classic.land.PlatformPageLand;
import com.yidiandao.business.ui.onekeyshare.themes.classic.port.EditPagePort;
import com.yidiandao.business.ui.onekeyshare.themes.classic.port.PlatformPagePort;
import com.yidiandao.business.utils.UIUtils;

import cn.sharesdk.framework.Platform;
import cn.sharesdk.framework.Platform.ShareParams;

/** 九宫格经典主题样式的实现类 */
public class ClassicTheme extends OnekeyShareThemeImpl {

    /** 展示平台列表 */
    protected void showPlatformPage(Context context) {
        PlatformPage page;
        int orientation = UIUtils.getResources().getConfiguration().orientation;
        if (orientation == Configuration.ORIENTATION_PORTRAIT) {
            page = new PlatformPagePort(this);
        } else {
            page = new PlatformPageLand(this);
        }
        page.show(context, null);
    }

    /** 展示编辑界面 */
    protected void showEditPage(Context context, Platform platform, ShareParams sp) {
        EditPage page;
        int orientation = UIUtils.getResources().getConfiguration().orientation;
        if (orientation == Configuration.ORIENTATION_PORTRAIT) {
            page = new EditPagePort(this);
        } else {
            page = new EditPageLand(this);
        }
        page.setPlatform(platform);
        page.setShareParams(sp);
        page.show(context, null);
    }
}
